package cn.huaqingcheng.tianshu.core.auth.jwt;

import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.jetbrains.annotations.Nullable;

/**
 * JwtPayload
 */
@Data
@NoArgsConstructor
@Accessors(chain = true)
@ToString(doNotUseGetters = true)
public class JwtPayload {

    /**
     * 签发人
     */
    @Nullable
    private String issuer;

    /**
     * 令牌类型
     */
    private TokenType type;

    /**
     * 主题
     */
    private String subject;

    /**
     * 账号
     */
    private Long accountId;


    public enum TokenType {
        /**
         * 访问令牌
         */
        ACCESS,
        /**
         * 刷新令牌
         */
        REFRESH
    }

}
